/* 
 * 计算送票费
 * townId:送票区县Id (当deliverType=1时，该参可为任意值)
 * userType:用户类型 （0：散客 | 1：签约客户）
 * ticketSumCount:车票数
 * deliverWay:配送方式 (0:送票到门 | 1:车站自取)
 * stationId:车站自取id (当deliverType=0时，该参可为任意值)
*/
function sendFeeSum(townId,userType,ticketNum,deliveryWay,stationId){
	//* 送票费计算方式：
	//* 送票费 = 20元／件.3张车票为一件，不足3张车票按一件计
	var perSendPrice = 0;	// 基本送票费
	//alert(townId);
	if(deliveryWay == 0){
		if(townId != -1){
			jQuery.ajax({
				type:"post",
				url:"web/ajax/obtainSendPriceByAddress.htm",
				data: ({
					'townId':townId
				}),
				cache: false,
				async: false,
				timeout:20000,
				success:function(data){
					if(data.success){
						perSendPrice = data.sumSendPrice;
					}
				}
			});	
		}
	}else{ // 车站自取
		jQuery.ajax({
			type:"post",
			url:"web/ajax/obtainSendPriceByStation.htm",
			data: ({
				'deliveryStationId':stationId
			}),
			cache: false,
			async: false,
			timeout:20000,
			success:function(data){
				if(data.success){
					perSendPrice = data.sumSendPrice;
				}
			}
		})
	}
	
	var pay_order_num = 0;
	if(userType == 0){
		// 散客送票费
		pay_order_num = Math.ceil(ticketNum / 3);		// 件

	}else{
		// 签约单位送票费
		if(ticketNum >= 20){
			pay_order_num = Math.ceil(ticketNum / 10);		// 件
		}else{
			pay_order_num = Math.ceil(ticketNum / 3);		// 件
		}
	}
	
	return parseFloat(perSendPrice * pay_order_num);
}